<template>
  <PageBox :data="dataInfo" :isSelect="isSelect" :isCheckbox="isCheckbox" @tableRadioBtn="tableRadioBtn"
    @tableCheckboxBtn="tableCheckboxBtn" @searchBtn="getTbody">
    <template #search="{ search }" v-if="!isSelect">
      <ElFormItemBox label="报工单号" prop="produceNoTaskWorkBillNo">
        <ElInputBox :data="search" dataName="produceNoTaskWorkBillNo" />
      </ElFormItemBox>
      <ElFormItemBox label="报工人员" prop="employeeCode">
        <ElSelectBox :data="search" dataName="employeeCode" :all="{
          label: '全部',
          value: -1
        }" :options="options.personnel" />
      </ElFormItemBox>
    </template>
    <!-- <template #isDisableName="{ row }">
      <ElTagBox :data="row.isDisable" :options="options.state" />
    </template> -->
  </PageBox>
</template>

<script setup lang="ts">
const { proxy } = getCurrentInstance() as any;
import './pageCss.scss'; // 引入样式
const props = withDefaults(
  defineProps<{
    isSelect?: boolean;//是否是选择页面
    isCheckbox?: boolean;//是否多选
    search?: any;//筛选条件
    selectable?: Function;//筛选条件
  }>(),
  {

  },
);
import { useListComponent } from './pageTs'; // 引入逻辑
const { dataInfo, getTbody, options } = useListComponent(props);
const emit = defineEmits<{
  //fn为父组件引入子组件是定义的子组件事件属性，可随意定义
  (event: 'tableRadioBtn', row: any): void;
  (event: 'tableCheckboxBtn', arr: any): void;
}>();
//多选数据
const tableCheckboxBtn = (arr: any) => {
  emit('tableCheckboxBtn', arr);
};
//单选数据
const tableRadioBtn = (row: any) => {
  emit('tableRadioBtn', row);
};
import { getPersonnel } from '@/utils/optionsArr.ts';
onMounted(() => {
  getTbody()
  getPersonnel(options, 'personnel') //获取所有员工
});
</script>